package com.example.teach.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.teach.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Select("select * from user where user_id=#{teacherId}")
    User selectByteacherId(Integer teacherId);

    @Select("select user_name from user where id=#{userId}")
    String selectuserNameByUserId(Integer userId);

    @Select("select id from user where user_id=#{userId}")
    Integer selectId(Integer userId);

    @Select("select * from user where user_name like concat('%', #{teacherName}, '%')")
    List<User> selectlike(String teacherName);
}
